package com.cskaoyan.day30.work1._02factory._01simplefactory;

import com.cskaoyan.day30.work1._02factory._00bean.Animal;
import com.cskaoyan.day30.work1._02factory._00bean.Cat;
import com.cskaoyan.day30.work1._02factory._00bean.Dog;
import com.cskaoyan.day30.work1._02factory._00bean.Pig;

public class SimpleAnimalFactory {
    public Animal create(String name){
        if ("cat".equals(name)){
            return new Cat();
        }else if ("dog".equals(name)){
            return new Dog();
        }else if ("pig".equals(name)){
            return new Pig();
        }
        return null;
    }
}
